/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *                                                                         *
 ***************************************************************************/
#ifndef IFCONDITIONBLOCK_H
#define IFCONDITIONBLOCK_H

#include "instructionEnum.h"
/**
 * @brief The IfConditionBlock class 　指令信息提取类
 */
class IfConditionBlock
{
public:
    IfConditionBlock();

    friend QDataStream& operator <<(QDataStream &out,IfConditionBlock &myVector);

    friend QDataStream& operator >>(QDataStream &in,IfConditionBlock &myVector);

//    friend QDataStream& operator <<(QDataStream &out,IfConditionBlock &myVector)
//    {
//        out << (quint32)myVector.operatorType << (quint32)myVector.valueType<<
//               myVector.value_i<<(quint32)myVector.variableType<<myVector.variable_i;

//        return out;
//    }

//    friend QDataStream& operator >>(QDataStream &in,IfConditionBlock &myVector)
//    {
//        quint32 operatorType = myVector.operatorType;
//        quint32 valueType = myVector.valueType;
//        quint32 variableType = myVector.variableType;

//        in >> operatorType >> valueType >> myVector.value_i >> variableType >> myVector.variable_i;

//        return in;
//    }





    /**IfConditionBlock里的变量类型，IF_R,IF_AO,IF_AI等等*/
    IF_COND_TYPE variableType;
    /**IfConditionBlock里的值类型，IF_R,IF_AO,IF_AI等等*/
    IF_COND_TYPE valueType;
    /**IfConditionBlock里的运算操作符类型，GREATER,GREATER_EQU,EQU,SMALLER_EQU,SMALLER,NOT_EQU*/
    IF_OPERATOR_TYPE operatorType;
    /**
     * @brief front_addType         左侧数据类型【直接或是间接】
     */
    ADDRESSING_TYPE front_addType;
    /**
     * @brief back_addType          右侧数据类型【直接或是间接】
     */
    ADDRESSING_TYPE back_addType;

    /**变量AO[i]/AI[i]/GO[i]等里面的i的值*/
    int variable_i;
    /**值，当value类型为从constant类型时直接使用此值，当为R[i]等其他类型时当作i传入*/
    double value_i;

    ADDRESSING_TYPE i_addType;

    ADDRESSING_TYPE j_addType;

    ADDRESSING_TYPE k_addType;

    int pl_i;

    int pl_j;

    int pl_k;
};

#endif // IFCONDITIONBLOCK_H

